<!DOCTYPE html>
<html>

<head lang="en">
  <meta charset="UTF-8">
  <title>标题</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    body {
      width: 2000px;
      height: 2000px;
    }

    div {
      width: 200px;
      height: 200px;
      border: 1px solid red;
      overflow: auto;
    }

    img {
      vertical-align: top;
      width: 400px;
      height: 400px;
    }
  </style>
</head>

<body>
  <input type="button" value="按钮" id="btn" />
  <div>
    <img src="1.jpg" alt="" />
  </div>
</body>

</html>
<script src="jquery-1.12.4.js"></script>
<script>
  $(function () {
    // $('#btn').click(function () {
      // console.log($('div').scrollTop()+":"+$('div').scrollLeft())

      console.log($(window).scrollTop()+":"+$(window).scrollLeft())
    // })



  });
</script>